\chapter[Public Functions]{Public Functions}

\section{Public Functions}

\GRID comes with some \I{public functions} to help developer. A \I{public function} is a JavaScript function which is not related to a specific
\GRID (ie. it is not a \GRID method), but it can be called by any JavaScript code snippet to interact with an existing \GRID.

These are the \I{public functions} the developer can count on:
\\
\\
% {{{ os3grid_get_grid ( id ) - Gets an OS3Grid instance
\begin{FUNC}{os3grid\_get\_grid}
	\NAME{os3grid\_get\_grid ( id ) - Gets an OS3Grid instance by its id}
	\SYNOPSIS{ (\GRID) os3grid\_get\_grid ( id )}
	\DESCRIPTION
	{	
		This function will return the desired \GRID instance by obtaining it from the hidden structures
		in the web page. This function is usefull when you don't have a \GRID instance saved in some
		public variable, but need to interact with a specific \GRID you know the id.
	}
	\INPUT
	{
		\INPUTITEM{id}{\GRID id}
	}
	\OUTPUT { A valid instance of \GRID, or \texttt{undefined} if the \texttt{id} does not exists.}
\end{FUNC}
% }}}
\\
\\
% {{{ os3grid_set_cell_value ( full_id, val ) - Sets a cell value
\begin{FUNC}{os3grid\_set\_cell\_value}
	\NAME{os3grid\_set\_cell\_value ( full\_id, val ) - Sets a cell value}
	\SYNOPSIS{ (\GRID) os3grid\_set\_cell\_value ( full\_id, val )}
	\DESCRIPTION
	{	
		This function allows the user to modify a specific cell value by simply providing the
		\texttt{full\_id} and the new cell value.
	}
	\INPUT
	{
		\INPUTITEM{full\_id}{Fully qualified \GRID cell id.}
		\INPUTITEM{val}{\GRID cell value to be set.}
	}
	\OUTPUT { A valid instance of the \GRID where the cell value has been changed or \texttt{undefined} if the \GRID cound not be found.}
	\NOTES{
		\NOTESITEM{The \GRID will \B{not} be rendered back to reflect \GRID changes. If you need it, remember to call the \texttt{render()} method.}
	}
\end{FUNC}
% }}}
